package com.example.demo.service.Impl;

import com.example.demo.dao.BillNoMapper;
import com.example.demo.entity.Check.BillNoParams;
import com.example.demo.service.BillNoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class BillNoImpl implements BillNoService {

    @Autowired
    private BillNoMapper billNoMapper;

    @Override
    public String getBillNo(Map<String, Object> param) {//获取盘点单号
        BillNoParams billNoParams = new BillNoParams();

        billNoMapper.getBillNo(param);

        if(param.get("ok")!=null && (Long)param.get("ok")==1){
            System.out.println(param.get("billNo"));
            return (String) param.get("billNo");
        }else {
            throw new RuntimeException("获取单号失败"+billNoParams.getBillNo());
        }
    }
}
